#include "Circle.h"
#include "Square.h"
#include "Triangle.h"

int main() {
	cout << "2"<<endl;
	Point* p1 = new Point(0, 0);
	Circle* circle1 = new Circle(*p1, 2);
	circle1->draw();
	cout << "\t是否封闭：" << circle1->is_closed() << endl;
	circle1->outline(Shape::dashed);
	circle1->thickness(Shape::rough);
	circle1->draw();
	cout << "----------分割线-----------" << endl;
	Square* sq = new Square();
	sq->draw();
	Triangle* tri = new Triangle();
	tri->draw();
	cout << "----------分割线-----------" << endl;
	circle1->intersection(sq);
	sq->intersection(tri);
	tri->intersection(tri);
}


// Important aspects of a Shape ( refer to Page313-314) appear on the screen as a set of line segments. Implementation operations to vary the appearance of these segments: s.thickness(n) sets the line thickness to 0,1,2,or 3, where 2 is the default and 0 means invisible. In addition, a line segment can be solid, dashed, or dotted. This is set by the function Shape::outline().

// class  Shape{
// public:
//       virtual void rotate(int) = 0;
//       virtual void draw() = 0;
//       virtual bool is_closed() = 0;
//       // ...
// };
// Hint: 设计的函数是演示性的，被调用后显示一些信息即可，无需画图
// （30.0分） 


// Given classes Circle, Square, and Triangle derived from a class Shape, define a function intersection() that takes two Shape* arguments and calls suitable functions to detemine if the two shapes are overlap. It will be necessary to add suitable (virtual) functions to the classes to achieve this. Don't bother to write the code that checks for overlap.; just make sure the right functions are called. 
// （70.0分） 